package com.example.path;

import java.io.File;
import java.io.IOException;

/**
 * @author ZhengDing
 * @date 2022/1/28 9:25
 */

public class PathUtil {

    public static void main(String[] args) throws IOException {
        System.out.println(getCanonicalPath());
    }

    public static String getCanonicalPath() {
        File directory = new File("");//参数为空
        String courseFile = null;
        try {
            courseFile = directory.getCanonicalPath();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return courseFile;
    }
}
